package tech.aistar.mapper;


import org.apache.ibatis.annotations.*;
import tech.aistar.entity.Choose;
import tech.aistar.entity.Concern;
import tech.aistar.entity.Image;
import tech.aistar.entity.Landlord;

import java.util.List;

public interface LandlordMapper {
    @Select("select * from landlord")
    List<Landlord> selectAll();

    @Insert("insert into landlord (register_id,identity) values (#{registerId},#{identity})")
    void insertLandlord(@Param("registerId") Integer registerId,@Param("identity") String identity);


    @Insert("insert into landlord values(name,photograph,gender,phone,identity,registerId)")
    void insert(Landlord landlord);
    @Update("update landlord set name=#{name},photograph=#{photograph},gender=#{gender},phone=#{phone}" +
            ",identity=#{identity},register_id=#{registerId} where id=#{Id}")
    void  updateByPrimaryKey(Landlord landlord);

    @Delete("delete from landlord where id=#{id}")
    void deleteByPrimaryKey(Integer id);


    @Select("select * from landlord where id=#{value}")
    Landlord selectById(Integer id);


    @Update("update landlord set phone=#{phone} where id=#{id}")
    int updateById(@Param("phone") String phone, @Param("id") Integer id);

    @Update("update landlord set name=#{name} where id=#{id}")
    int updateNameById(@Param("name") String name,@Param("id") Integer id);

    @Update("update landlord set gender=#{gender} where id=#{id}")
    int updategenderById(@Param("gender") String gender,@Param("id") Integer id);



    @Select("select * from landlord where register_id=#{registerId}")
    Landlord selectByregisterId(Integer registerId);


}

